<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Shopping List</title>
  <!-- Latest compiled and minified CSS -->
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
  <style>
    .container {
      width: 40%;
      margin: 20px auto 0px auto;
    }

    .removed label {
      text-decoration: line-through;
    }

    ul li {
      list-style-type: none;
    }

    ul li span {
      margin-left: 5px;
    }

    .footer {
      font-size: 0.7em;
      margin-top: 20vh;
    }
  </style>
</head>
<body>

<!--add new item template-->
<template id="add-item-template">
  <div class="input-group">
    <input @keyup.enter="addItem" v-model="newItem" placeholder="add shopping list item" type="text" class="form-control">
    <span class="input-group-btn">
      <button @click="addItem" class="btn btn-default" type="button">Add!</button>
    </span>
  </div>
</template>

<!--list item template-->
<template id="item-template">
  <li :class="{ 'removed': item.checked }">
    <div class="checkbox">
      <label>
        <input type="checkbox" v-model="item.checked"> {{ item.text }}
      </label>
    </div>
  </li>
</template>

<!--items list template-->
<template id="items-template">
  <ul>
    <item-component v-for="item in items" :item="item"></item-component>
  </ul>
</template>

<!--change title template-->
<template id="change-title-template">
  <div>
    <em>Change the title of your shopping list here</em>
    <input v-bind:value="value" v-on:input="onInput"/>
  </div>
</template>

<!--main container markup-->
<div id="app" class="container">
  <h2>{{ title }}</h2>
  <add-item-component v-on:add="addItem" :items="items"></add-item-component>
  <items-component :items="items"></items-component>
  <div class="footer">
    <hr/>
    <change-title-component v-model="title"></change-title-component>
  </div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.0.3/vue.js"></script>
<script src="script.js"></script>
</body>
</html>